home *** CD-ROM | disk | FTP | other *** search
- /*
- Define the getpid() functions on the Macintosh.
- Cannot use <unix.h> because it introduces name space conflicts.
-
- IMT 4 Jan 93
-
- Modified to work with both MetroWerks & Think C by
- IMT 29 Nov 94 based on info provided by Dirk Froehling
- */
-
-
- #if defined(THINK_C) || defined(__MWERKS__)
-
- #if defined(THINK_C)
- extern int __pid;
- extern int __ppid;
- extern int __uid;
- extern int __gid;
-
- #undef getpid
- #undef getpgrp
- #undef getppid
- #undef getuid
- #undef geteuid
- #undef getgid
- #undef getegid
- #endif
-
- #ifdef __MWERKS__
- int __pid = 57;
- int __ppid = 18;
- int __uid = 24;
- int __gid = 31;
- #endif
-
-
- int getpid( void )
- {
- return __pid;
- }
-
- int getpgrp( void )
- {
- return __pid;
- }
-
- int getppid( void )
- {
- return __ppid;
- }
-
- int getuid( void )
- {
- return __uid;
- }
-
- int geteuid( void )
- {
- return __uid;
- }
-
- int getgid( void )
- {
- return __gid;
- }
-
- int getegid( void )
- {
- return __gid;
- }
-
- #endif